#ifndef PWIDGET_H
#define PWIDGET_H

#include <QTime>
#include <QTimer>
#include <QString>
#include <QtDBus>

#include <QPaintEvent>
#include <QPainter>
#include <QWidget>
#include <QList>

struct message {
    int type;
    QString From, Message;
};


class QDigitalClock : public QWidget {
    Q_OBJECT
    public:
        QDigitalClock(QWidget * parent = 0);
        ~QDigitalClock();
    protected:
        void paintEvent(QPaintEvent * event);
    private:
        QTimer * sync;
        QTime * clock;
        QFont tFont;

};

class QBattery : public QWidget {
    Q_OBJECT
    public:
        QBattery(QWidget * parent=0);
        ~QBattery();
    protected:
        void paintEvent(QPaintEvent * event);
    private:
        int charge, animationTime;
        bool Charging;
        QTimer * chargeAnimation;

    private slots:
        void setLevel(bool c,int l);
        void animationUpdate();
};

class QNotification : public QWidget {
    Q_OBJECT
    public:
        QNotification(QWidget * parent = 0);
        ~QNotification();
    protected:
        void paintEvent(QPaintEvent * event);
    private:
        QList <QString> calls;
        QList <message> messages;
        bool alert;
        QString path;

    private slots:
        void newMessage(QString From, QString Message);
        void newCall(QString from);
        void batteryAllert(bool charging, int level);
};

#endif // PWIDGET_H
